# 嵌套字典示例：学生信息系统
students = {
    "student1": {
        "name": "Alice",
        "age": 20,
        "grades": {"math": 95, "english": 88, "science": 92},
    },
    "student2": {
        "name": "Bob",
        "age": 21,
        "grades": {"math": 85, "english": 90, "science": 78},
    },
}

# 访问嵌套数据
print(students["student1"]["name"])  # "Alice"
print(students["student1"]["grades"]["math"])  # 95

# 修改嵌套数据
students["student2"]["grades"]["science"] = 85

# 添加新学生
students["student3"] = {
    "name": "Charlie",
    "age": 22,
    "grades": {"math": 92, "english": 85, "science": 95},
}
